package com.anlogic.sdk.openocd.model;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;

public class JtagCableModel {
	private boolean isAutoDetected = true;
	
	private JtagCable selectionCable;
	
	private JtagDevice selectionDevice;
	
	private JtagDevice manualSelectionDevice;
	
	private List<JtagCable> autoDetected = new ArrayList<>();
	
	private List<JtagDevice> manualConfig = new ArrayList<>();
	
	public boolean isAutoDetected() {
		return this.isAutoDetected;
	}
	
	public void isAutoDetected(boolean isAutoDetected) {
		this.isAutoDetected = isAutoDetected;
	}
	
	public List<JtagCable> getAutoDetected() {
		return this.autoDetected;
	}
	
	public void setAutoDetected(List<JtagCable> devices) {
		this.autoDetected = devices;
	}
	
	public List<JtagDevice> getManualConfig() {
		return this.manualConfig;
	}
	
	public void setManualConfig(List<JtagDevice> devices) {
		this.manualConfig = devices;
	}
	
	public JtagCable getSelectionCable() {
		return this.selectionCable;
	}
	
	public void setSelectionCable(JtagCable device) {
		this.selectionCable = device;
	}
	
	public JtagDevice getSelectionDevice() {
		return this.selectionDevice;
	}
	
	public void setSelectionDevice(JtagDevice device) {
		this.selectionDevice = device;
	}
	
	public JtagDevice getManualSelectionDevice() {
		return this.manualSelectionDevice;
	}
	
	public void setManualSelectionDevice(JtagDevice device) {
		this.manualSelectionDevice = device;
	}
	
	public String toJsonString() {
		Gson gson = new Gson();
		return gson.toJson(this);
	}
	
	public JtagCableModel readJsonString(String json) {
		Gson gson = new Gson();
		return gson.fromJson(json, JtagCableModel.class);
	}
}
